+Mon Jul 20 21:28:18 1998 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkctree.c (gtk_ctree_post_recursive_to_depth)
+ (gtk_ctree_pre_recursive_to_depth): new functions, recursive process
+ tree to specified depth
+ (gtk_ctree_expand_to_depth): expand tree to specified depth
+ (gtk_ctree_collapse_to_depth): collapse all nodes with level >= depth
+
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
+Mon Jul 20 21:28:18 1998 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkctree.c (gtk_ctree_post_recursive_to_depth)
+ (gtk_ctree_pre_recursive_to_depth): new functions, recursive process
+ tree to specified depth
+ (gtk_ctree_expand_to_depth): expand tree to specified depth
+ (gtk_ctree_collapse_to_depth): collapse all nodes with level >= depth
+
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
+Mon Jul 20 21:28:18 1998 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkctree.c (gtk_ctree_post_recursive_to_depth)
+ (gtk_ctree_pre_recursive_to_depth): new functions, recursive process
+ tree to specified depth
+ (gtk_ctree_expand_to_depth): expand tree to specified depth
+ (gtk_ctree_collapse_to_depth): collapse all nodes with level >= depth
+
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
+Mon Jul 20 21:28:18 1998 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkctree.c (gtk_ctree_post_recursive_to_depth)
+ (gtk_ctree_pre_recursive_to_depth): new functions, recursive process
+ tree to specified depth
+ (gtk_ctree_expand_to_depth): expand tree to specified depth
+ (gtk_ctree_collapse_to_depth): collapse all nodes with level >= depth
+
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
+Mon Jul 20 21:28:18 1998 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkctree.c (gtk_ctree_post_recursive_to_depth)
+ (gtk_ctree_pre_recursive_to_depth): new functions, recursive process
+ tree to specified depth
+ (gtk_ctree_expand_to_depth): expand tree to specified depth
+ (gtk_ctree_collapse_to_depth): collapse all nodes with level >= depth
+
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
+Mon Jul 20 21:28:18 1998 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkctree.c (gtk_ctree_post_recursive_to_depth)
+ (gtk_ctree_pre_recursive_to_depth): new functions, recursive process
+ tree to specified depth
+ (gtk_ctree_expand_to_depth): expand tree to specified depth
+ (gtk_ctree_collapse_to_depth): collapse all nodes with level >= depth
+
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
+Mon Jul 20 21:28:18 1998 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkctree.c (gtk_ctree_post_recursive_to_depth)
+ (gtk_ctree_pre_recursive_to_depth): new functions, recursive process
+ tree to specified depth
+ (gtk_ctree_expand_to_depth): expand tree to specified depth
+ (gtk_ctree_collapse_to_depth): collapse all nodes with level >= depth
+
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
static void tree_collapse (GtkCTree *ctree,
GList *node,
gpointer data);
+static void tree_collapse_to_depth (GtkCTree *ctree,
+ GList *node,
+ gint depth);
static void tree_toggle_expansion (GtkCTree *ctree,
GList *node,
gpointer data);
data);
}
+static void
+tree_collapse_to_depth (GtkCTree *ctree,
+ GList *node,
+ gint depth)
+{
+ if (node && GTK_CTREE_ROW (node)->level == depth)
+ gtk_ctree_collapse_recursive (ctree, node);
+}
+
static void
tree_toggle_expansion (GtkCTree *ctree,
GList *node,
GList *work;
GList *tmp;
+ g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
+
if (node)
work = GTK_CTREE_ROW (node)->children;
else
func (ctree, node, data);
}
+void
+gtk_ctree_post_recursive_to_depth (GtkCTree *ctree,
+ GList *node,
+ gint depth,
+ GtkCTreeFunc func,
+ gpointer data)
+{
+ GList *work;
+ GList *tmp;
+
+ g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
+
+ if (depth < 0)
+ {
+ gtk_ctree_post_recursive (ctree, node, func, data);
+ return;
+ }
+
+ if (node)
+ work = GTK_CTREE_ROW (node)->children;
+ else
+ work = GTK_CLIST (ctree)->row_list;
+
+ if (work && GTK_CTREE_ROW (work)->level <= depth)
+ {
+ while (work)
+ {
+ tmp = GTK_CTREE_ROW (work)->sibling;
+ gtk_ctree_post_recursive_to_depth (ctree, work, depth, func, data);
+ work = tmp;
+ }
+ }
+
+ if (node && GTK_CTREE_ROW (node)->level <= depth)
+ func (ctree, node, data);
+}
+
void
gtk_ctree_pre_recursive (GtkCTree *ctree,
GList *node,
GList *work;
GList *tmp;
+ g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
if (node)
{
}
}
+void
+gtk_ctree_pre_recursive_to_depth (GtkCTree *ctree,
+ GList *node,
+ gint depth,
+ GtkCTreeFunc func,
+ gpointer data)
+{
+ GList *work;
+ GList *tmp;
+
+ g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
+
+ if (depth < 0)
+ {
+ gtk_ctree_pre_recursive (ctree, node, func, data);
+ return;
+ }
+
+ if (node)
+ {
+ work = GTK_CTREE_ROW (node)->children;
+ if (GTK_CTREE_ROW (node)->level <= depth)
+ func (ctree, node, data);
+ }
+ else
+ work = GTK_CLIST (ctree)->row_list;
+
+ if (work && GTK_CTREE_ROW (work)->level <= depth)
+ {
+ while (work)
+ {
+ tmp = GTK_CTREE_ROW (work)->sibling;
+ gtk_ctree_pre_recursive_to_depth (ctree, work, depth, func, data);
+ work = tmp;
+ }
+ }
+}
+
gboolean
gtk_ctree_is_visible (GtkCTree *ctree,
GList *node)
gboolean thaw = FALSE;
g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
clist = GTK_CLIST (ctree);
gtk_clist_thaw (clist);
}
+void
+gtk_ctree_expand_to_depth (GtkCTree *ctree,
+ GList *node,
+ gint depth)
+{
+ GtkCList *clist;
+ gboolean thaw = FALSE;
+
+ g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
+
+ clist = GTK_CLIST (ctree);
+
+ if (node && GTK_CTREE_ROW (node)->is_leaf)
+ return;
+
+ if (((node && gtk_ctree_is_visible (ctree, node)) || !node) &&
+ !GTK_CLIST_FROZEN (clist))
+ {
+ gtk_clist_freeze (clist);
+ thaw = TRUE;
+ }
+
+ gtk_ctree_post_recursive_to_depth (ctree, node, depth,
+ GTK_CTREE_FUNC (tree_expand), NULL);
+
+ if (thaw)
+ gtk_clist_thaw (clist);
+}
+
void
gtk_ctree_collapse (GtkCTree *ctree,
GList *node)
gboolean thaw = FALSE;
g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
if (node && GTK_CTREE_ROW (node)->is_leaf)
return;
gtk_clist_thaw (clist);
}
+void
+gtk_ctree_collapse_to_depth (GtkCTree *ctree,
+ GList *node,
+ gint depth)
+{
+ GtkCList *clist;
+ gboolean thaw = FALSE;
+
+ g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
+
+ if (node && GTK_CTREE_ROW (node)->is_leaf)
+ return;
+
+ clist = GTK_CLIST (ctree);
+
+ if (((node && gtk_ctree_is_visible (ctree, node)) || !node) &&
+ !GTK_CLIST_FROZEN (clist))
+ {
+ gtk_clist_freeze (clist);
+ thaw = TRUE;
+ }
+
+ gtk_ctree_post_recursive_to_depth (ctree, node, depth,
+ GTK_CTREE_FUNC (tree_collapse_to_depth),
+ GINT_TO_POINTER (depth));
+
+ if (thaw)
+ gtk_clist_thaw (clist);
+}
+
void
gtk_ctree_toggle_expansion (GtkCTree *ctree,
GList *node)
* information *
***********************************************************/
-void gtk_ctree_post_recursive (GtkCTree *ctree,
- GList *node,
- GtkCTreeFunc func,
- gpointer data);
-void gtk_ctree_pre_recursive (GtkCTree *ctree,
- GList *node,
- GtkCTreeFunc func,
- gpointer data);
-gboolean gtk_ctree_is_visible (GtkCTree *ctree,
- GList *node);
-GList * gtk_ctree_last (GtkCTree *ctree,
- GList *node);
-GList * gtk_ctree_find_glist_ptr (GtkCTree *ctree,
- GtkCTreeRow *ctree_row);
-gint gtk_ctree_find (GtkCTree *ctree,
- GList *node,
- GList *child);
-gboolean gtk_ctree_is_ancestor (GtkCTree *ctree,
- GList *node,
- GList *child);
-GList * gtk_ctree_find_by_row_data (GtkCTree *ctree,
- GList *node,
- gpointer data);
-gboolean gtk_ctree_is_hot_spot (GtkCTree *ctree,
- gint x,
- gint y);
+void gtk_ctree_post_recursive (GtkCTree *ctree,
+ GList *node,
+ GtkCTreeFunc func,
+ gpointer data);
+void gtk_ctree_post_recursive_to_depth (GtkCTree *ctree,
+ GList *node,
+ gint depth,
+ GtkCTreeFunc func,
+ gpointer data);
+void gtk_ctree_pre_recursive (GtkCTree *ctree,
+ GList *node,
+ GtkCTreeFunc func,
+ gpointer data);
+void gtk_ctree_pre_recursive_to_depth (GtkCTree *ctree,
+ GList *node,
+ gint depth,
+ GtkCTreeFunc func,
+ gpointer data);
+gboolean gtk_ctree_is_visible (GtkCTree *ctree,
+ GList *node);
+GList * gtk_ctree_last (GtkCTree *ctree,
+ GList *node);
+GList * gtk_ctree_find_glist_ptr (GtkCTree *ctree,
+ GtkCTreeRow *ctree_row);
+gint gtk_ctree_find (GtkCTree *ctree,
+ GList *node,
+ GList *child);
+gboolean gtk_ctree_is_ancestor (GtkCTree *ctree,
+ GList *node,
+ GList *child);
+GList * gtk_ctree_find_by_row_data (GtkCTree *ctree,
+ GList *node,
+ gpointer data);
+gboolean gtk_ctree_is_hot_spot (GtkCTree *ctree,
+ gint x,
+ gint y);
/***********************************************************
* Tree signals : move, expand, collapse, (un)select *
GList *node);
void gtk_ctree_expand_recursive (GtkCTree *ctree,
GList *node);
+void gtk_ctree_expand_to_depth (GtkCTree *ctree,
+ GList *node,
+ gint depth);
void gtk_ctree_collapse (GtkCTree *ctree,
GList *node);
void gtk_ctree_collapse_recursive (GtkCTree *ctree,
GList *node);
+void gtk_ctree_collapse_to_depth (GtkCTree *ctree,
+ GList *node,
+ gint depth);
void gtk_ctree_toggle_expansion (GtkCTree *ctree,
GList *node);
void gtk_ctree_toggle_expansion_recursive (GtkCTree *ctree,